package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.entity.Account;
import org.example.entity.Authority;

import java.util.List;

@Mapper
public interface AccountMapper extends BaseMapper<Account> {

    //根据用户名取得用户权限
        @Select(value = "select a.* from t_customer c,t_authority a,t_customer_authority ca where ca.customer_id=c.id and ca" +
            ".authority_id=a.id and c.username =#{username}")
    public List<Authority> findAuthoritiesByUsername(String username);

}